<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="../static/easyui/jquery.min.js"></script>
<script type="text/javascript" src="../static/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="../static/easyui/locale/easyui-lang-zh_CN.js"></script>
<link rel="stylesheet" href="../static/easyui/themes/icon.css">
<link rel="stylesheet" href="../static/easyui/themes/metro-orange/easyui.css">

</head>
<body>
    <script type="text/javascript">
		$(function(){
			//初始化表格
			//笔试结果表
			$('#bishi_jilubiao').datagrid({
			    url:'bishi_jilushouye',
			    columns:[[
			    	/* {field:'RSEID',width:1,title:'简历编号',align:'center'}, */
					{field:'RSENAME',width:1,title:'姓名',align:'center'},
					{field:'TRTSFENS',width:1,title:'成绩',align:'center'},
					{field:'fenshu',width:1,title:'合格标准',align:'center',
						formatter:function(value){
							return "60"
						}
					}, 
					{field:'bishi_caozuo',width:1,title:'操作',align:'center',
						formatter:function(value,row,index){
							if(row["WENQLD"]==""){
								return "<input type='button' value='合格' onclick='bishihege()'>\
						        <input type='button' value='不合格'onclick='bishibuhege()'>"
							}else if(row["WENQLD"]=="1"){
								return "笔试通过"
							}else if(row["WENQLD"]=="2"){
								return "不合格"
							}else if(row["WENQLD"]=="3"){
								return "笔试结束"
							}else{
								return "错误状态"
							}
						}
					}
			    ]],
			    stoolbar:'#bishi_jilubiao',
			    pagination:true,
			    pageNumber:1,
			    pageSize:10,
			    pageList:[10,20,30]
			});
			//面试结果表
			$('#mianshi_jilubiao').datagrid({
			    url:'mianshi_jilu',
			    columns:[[
			    	/* {field:'RSEID',width:166,title:'简历编号',align:'center'}, */
					{field:'RSENAME',width:1,title:'姓名',align:'center'},
					{field:'EMPNAME',width:1,title:'面试官',align:'center'},
					{field:'IRWQLD',width:1,title:'结果',align:'center',
						formatter:function(value,row,index){
							if(value==""){
								return "未审核"
							}else if(value=="合格"){
								return "面试合格"
							}else if(value=="不合格"){
								return "面试不合格"
							}else{
								return "面试错误状态"
							}
						}
					},
					{field:'IRWREM',width:3,title:'备注',align:'center'},
					{field:'mianshi_caozuo',width:1,title:'操作',align:'center',
						formatter:function(value,row,index){
							if(row["IRWQLD"]==""){
								return "<input type='button' value='合格' onclick='mianshishihege()'>\
						        <input type='button' value='不合格'onclick='mianshibuhege()'>"
							}else{
								return "无操作"
							}
							
						}
					} 
			    ]],
			     stoolbar:'#mianshi_jilubiao',
			    pagination:true,
			    pageNumber:1,
			    pageSize:10,
			    pageList:[10,20,30]
			});
			
			//打开添加笔试成绩
			$("#bishi_jiemian").click(function(){
				$("#bishi_tian").window("open");
			});
			//打开添加面试
		    $("#mianshi_jiemian").click(function(){
		    	$('#kaoshibishirseid').combobox({
					url:'bishirseidwenid',
					valueField:'RSEID',
					/* formatter:function(row){
						row.ZONGID = row.RSEID+"@"+row.WENID;
			               return row.ZONGID;
			        },  */
			        textField:"RSENAME"
				});
		    	//rseid
		    	/* $.ajax({
	        		type:"post",
	        		url:"mianshi_reesidss",
	        		data:{mianshiidrseid:$("#kaoshibishirseid").val()},
	        		success:function(){
	        			
	        		}
	        	}) */
		    	$("#mianshi_tian").window("open");
		    });
			//
		    /* $("#kaoshi_quxiao").click(function(){
		    	$("#mianshi_tian").window("close");
		    }); */
		    //添加面试数据
		    $("#mianshi_queding").click(function(){
		    	/* var zzxzid = $("#mianshi_msren").val();
				paramArray=zzxzid.split("@");
				rseid=paramArray[0];
				wenid=paramArray[1]; */
		    	//新增面试数据
		    	$.ajax({
		    		type:"post",
		    		url:"xz_mianshi",
		    		data:{
		    			msren:$("#kaoshibishirseid").val(),
		    			msguan:$("#mianshi_msguan").val(),
		    			msbeizhu:$("#mianshi_beizhu").val(),
		    		},
		    		success:function(){
		    			$("#mianshi_jilubiao").datagrid();
		    			$("#mianshi_beizhu").val("");
		    			$("#mianshi_tian").window("close");
		    		}
		    	});
		    	//面试合格则添加最终审核记录
		    	 /* if($("#mianshi_jieguo").val()=="合格"){
		    		 $.ajax({
				     	type:"post",
				     	url:"shenhe_zuizhong",
				     	data:{
				     		rseid:rseid,
				     		wenid:wenid
				     	},
				     	success:function(){
				     		$("#mianshi_tian").window("close");
				     	}
				     }) 
		    	}else{
		    		
		    	}  */
		    });
		    //关闭添加面试窗口
		    $("#mianshi_quxiao").click(function(){
		    	//alert($("#kaoshibishirseid").val());
		    	$("#mianshi_jieguo").val("合格");
    			$("#mianshi_beizhu").val("");
		    	$("#mianshi_tian").window("close");
		    })
		});
		//笔试通过
		function bishihege(){
        	var rows=$("#bishi_jilubiao").datagrid("getChecked");
        	alert(rows[0].WENID);
        	$.ajax({
        		type:"post",
        		url:"bishi_tongguole",
        		data:{bishitongguo_id:rows[0].WENID},
        		success:function(){
        			//$("#bishi_jilubiao").datagrid();
        			adds("测试记录","oyp/recruit-kaoshi");
        		}
        	})
        }
		//笔试不通过
		function bishibuhege(){
        	var rows=$("#bishi_jilubiao").datagrid("getChecked");
        	alert(rows[0].WENID);
        	$.ajax({
        		type:"post",
        		url:"bishi_meitongguole",
        		data:{bishibutongguo_id:rows[0].WENID},
        		success:function(){
        			$("#bishi_jilubiao").datagrid();
        		}
        	})
        }
		//打开添加面试记录
		/* function kaimsjilu(){
			$("#mianshi_tian").window("open");
			$('#kaoshibishirseid').combobox({
				url:'bishirseidwenid',
				valueField:'RSEID',
				formatter:function(row){
		               row.SHFNAME = row.SHFNAME+"  "+row.SHFREM;
		               return row.RSENAME;
		        },
		        textField:"RSENAME"
			});
		} */
		//合格按钮
		function mianshishihege(){
			var rows=$("#mianshi_jilubiao").datagrid("getChecked");
			//面试通过
		     $.ajax({
				type:"post",
				url:"mianshi_tongguo",
				data:{mianshi_irw:rows[0].IRWID,
					  mianshi_wen:rows[0].WENID
				},
				success:function(){
	    			$("#bishi_jilubiao").datagrid();
					$("#mianshi_jilubiao").datagrid();
				}
			});
			//添加最终审核记录
		     $.ajax({
			    type:"post",
			    url:"shenhe_zuizhong",
			    data:{
			    	mianshi_irw:rows[0].IRWID,
					mianshi_wen:rows[0].WENID,
					mianshi_rse:rows[0].RSEID
			    },
			    success:function(){
			    	
			    }
			 }) 
		}
	</script>
    <div class="kaoshibox">
        <div class="topbox">
              <center><div style="margin-top:20px;font-size:20px;">测试详情</div></center>
              <div class="anbox">
                  <!-- <div style="float:left"><input type="button" value="简历详情" onclick="adds('简历详情','oyp/recruit-jinali')"></div> -->
                  <!-- <div style="float:left"><input type="button" value="初步审核" onclick="adds('初步审核','oyp/recruit-chushenhe')"></div>
                  <div style="float:left"><input type="button" value="最终审核" onclick="adds('最终审核','oyp/recruit-zzshenhe')"></div> -->
              </div>
          </div>
          <div class="zhubox">
              <div class="zhujie">
                 <div style="width:100%;">
                    <div class="bishiboxs">
                       <div style="margin:0px 10px;padding:10px 0px;">
	                       <div class="bstitle">
	                          <span style="margin-left:10px;">笔试记录</span>
	                          <!-- <span id="bishi_jiemian" style="float:right;">
	                          	<input type="button" value="添加笔试记录">
	                          </span> -->
	                       </div>
	                       <table id="bishi_jilubiao" class="easyui-datagrid"style="width:calc(100% - 10px);height:450px;"data-options="fitColumns:true,singleSelect: true">
                            </table>
                       </div>   
                    </div>
                    <div class="mianshiboxs">
                       <div style="margin:0px 10px;padding:10px 0px;">
                       		<div class="mstitle">
                               <span style="font-size:17px;margin-left:10px;">面试记录</span>
                               <span id="mianshi_jiemian" style="float:right;">
                                   <input type="button" value="添加面试记录" id="">
                               </span>
                            </div>
                            <table id="mianshi_jilubiao" class="easyui-datagrid"style="width:calc(100% - 10px);height:450px;"data-options="fitColumns:true,singleSelect: true">
                            </table>
                            
                       </div>
                    </div>
                 </div>
              </div>
         </div>
         <div id="bishi_tian" class="easyui-window" title="笔试记录" style="width:690px;height:420px"data-options="closed:true,minimizable:false,maximizable:false,collapsible:false">
		      <div></div>
		  </div>
         <div id="mianshi_tian" class="easyui-window" title="面试记录" style="width:610px;height:300px"data-options="closed:true,minimizable:false,maximizable:false,collapsible:false">
		 	<div class="zong_ceshise">
		 		<div style="width:100%;height:75px;padding-top:10px;">
		 			<div style="float:left;padding:0px 0px 0px 30px;">
		 	            <div class="gekailes">
		 	            	<span>面试人：</span>
		 	            	<input id="kaoshibishirseid" class="easyui-combobox">
		 	            	<%-- <select id="mianshi_msren" class="zxms_kuang">
				            	<c:forEach items="${ksrse }" var="rse">
				            		<option  value="${rse.RSEID }@${rse.WENID}">${rse.RSEID }-${rse.RSENAME }</option>
				            	</c:forEach>
				            </select> --%>
		 	            </div>
		 	        </div>
		 	        <div style="float:left;padding:0px 0px 0px 30px;">
		 	           <div class="gekailes">
		 	        		<span>面试官：</span>
		 	        		<select id="mianshi_msguan" class="zxms_kuang">
				            	<c:forEach items="${fuzerennames }" var="fuze">
				            		<option  value="${fuze.EMPID }">${fuze.EMPNAME }</option>
				            	</c:forEach>
				            </select>
		 	        	</div>
		 	        </div>
		 	       <!--  <div style="float:left;padding:0px 0px 0px 30px;">
		 	        	<div class="gekailes">
		 	        		<span>结&nbsp;&nbsp;&nbsp;果：</span>
		 	        		<select id="mianshi_jieguo" class="zxms_kuang">
					            <option>合格</option>
					            <option>不合格</option>
				            </select>
		 	        	</div>
		 	        </div> -->
		 		</div>
		 	    <div style="width:100%;padding:0px 0px 0px 30px;position:relative;">
		 	       <!-- <div class="gekailes gekailes_ss">结果：
		 	          <input type="text" id="mianshi_jieguo" class="zxms_kuang changkuang">
		 	       </div> -->
		 	       <div class="gekailes gekailes_ss">
		 	       		<span style="position:relative;top:-60px; left:0px;">备&nbsp;&nbsp;&nbsp;注：</span>
		 	       		<textarea class="gzjingli_shuru" id="mianshi_beizhu" type="text" rows="4" cols="45" style="font-size:17px;resize:none;"></textarea>
		 	       </div>
		 	    </div>
		 	    <div style="width:100%;">
		 	    	<center>
			 	    	<div class="gekailes">
				 	    	<input type="button" value="确认" class="anssepps" id="mianshi_queding">
				 	    	<input type="button" value="取消" class="anssepps" id="mianshi_quxiao">
				 	    </div>
			 	    </center>
		 	    </div>
		 	</div>
		 </div>
    </div>
</body>
</html>